//
//  PlayModel.swift
//  TianTianBiTing
//
//  Created by Gox mac 2 on 2018/12/24.
//  Copyright © 2018 Gox_WallyDiao. All rights reserved.
//

import Foundation
import HandyJSON

struct PlayListModel: HandyJSON {
    var id: Int = 0
    var title: String?
    var describe: String?
    var imageUrl: String?
    var season: String?
    var playUrl: String?
    var listenNum: Int = 0
    var price: NSNumber?
    var programId: Int = 0
    var buySelf: Int = 0 // 0未买 1买过和免费
    var tryStatus: Int = 0 // 0可试听 1不可试听
    var totalPrice: NSNumber = 1 // 1未买
    
}

struct PlayDetailsModel: HandyJSON {
    var id: Int = 0
    var title: String?
    var describe: String?
    var statusStr: String?
    var status: Int = 0
    var totalSeason: Int = 0
    var imageUrl: String?
    var shareImageUrl: String?
    var detailImageUrl: String?
    var playUrl: String?
    var category: Int = 0
    var listenNum: Int = 0
    var shareStatus: String?
    var deadline: String?
    var markStatus: Int = 1
    var createtime: Int = 0
    var currentSeason: Int = 0
    var seasonId: Int = 0
    var tryStatus: Int = 0
    var groupStatus: Int = 0
    var useMockData: Int = 0
    var mockTotalUser: Int = 0
    var sort: Int = 0
    var flag: Int = 0
    var useH5: Int = 0
    var totalCount: NSNumber = 0.0
    var everySeasonBuy: Int = 0
    var listen: Bool = false
    var h5Url: String = ""
    var progress:Double = 0.0
}

struct CommentModel: HandyJSON {
    var content: String?
    var countDiscuss: Int = 0
    var createTime: String?
    var createTimeStr: String?
    var userId: Int = 0
    var id: Int = 0
    var programId: Int = 0
    var status: Int = 0
    var updateTime: String?
    var user: UserInfoModel?
    var childCommentModel:[CommentModel]?
    var open:Bool = false
    
    mutating func setIsOpen() {
        open = !open
    }
    
    mutating func setChildComment(model:[CommentModel]) {
        childCommentModel = model
    }
}
